﻿Imports System.Windows.Forms

Public Class frmFileConfig

    Private _NoCols As Boolean
    Public Property NoCols() As Boolean
        Get
            Return _NoCols
        End Get
        Set(ByVal value As Boolean)
            _NoCols = value
        End Set
    End Property

    Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
        My.Settings.sCustomFileDelim = Me.cboCustomFileDelim.SelectedItem
        My.Settings.Save()
        Me.tsslFileConfig.Text = "Settings Saved."
    End Sub

    Private Sub cmdClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdClose.Click
        Me.Close()
    End Sub

    Public Overloads Sub Show(ByVal OnlyTradeID As Boolean, Optional ByVal NoColumns As Boolean = False)
        If NoColumns Then
            Me.gbMandatoryData.Enabled = False
            Me.gbOptionalData.Enabled = False
            Me.cboCustomFileDelim.Enabled = False
            Me.txtDateFormat.Enabled = False
        Else
            If OnlyTradeID Then
                Me.txtDateFormat.Enabled = False
                Me.cboCustomFileDelim.Enabled = False
                Me.gbOptionalData.Enabled = False
                For Each ctrl As Control In gbMandatoryData.Controls
                    If Not ctrl.Name.Contains("nudTradeID") Then ctrl.Enabled = False
                Next
            End If
        End If





        MyBase.Show()
    End Sub

End Class